// protected类继承方式
#include <iostream>
using namespace std;

class Base 
{
private:
    int a;
protected:
    int b;
public:
    int c;
};

class Derived : protected Base
{
    void f()
    {
        //a = 100;  //错误，任何时候都不能访问父类的private成员
        b = 100;
        c = 100;
    }
};

int main(int argc, char const *argv[])
{
    Derived x;

    // x.a = 100;   错误
    // x.b = 100;   错误，b定义在protected中，不可以访问
    // x.c = 100;  //错误

    return 0;
}
